using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using CMS.Web;
using CMS.Presenters.Views.ListManager;
using CMS.Core.Domain;
using System.Collections.Generic;
using CMS.Presenters.Presenters.ListManager;
using AjaxPro;

namespace CMS.Web.Reports
{
    public partial class BaoCaoDonThu : BaseUserControl, IBaoCaoDonThuView
    {
        IList<LoaiDon> loaiDons = new List<LoaiDon>();
        IList<DiaBan> diaBans = new List<DiaBan>();
        IList<LinhVuc> linhVucs = new List<LinhVuc>();
        bool isRole = false;
        BaoCaoDonThuPresenter baoCaoDonThuPresenter;

        public BaoCaoDonThu()
        {
            this.baoCaoDonThuPresenter = new BaoCaoDonThuPresenter(this);
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            this.RaiseClientEvent();
            this.drpLinhVuc.DataSource = this.LinhVucs;
            this.drpLinhVuc.DataBind();
            this.drpLoaiDon.DataSource = this.LoaiDons;
            this.drpLoaiDon.DataBind();
            this.drpLinhVuc.Items.Insert(0, new ListItem("", "0"));
            this.drpLoaiDon.Items.Insert(0, new ListItem("", "0"));
            this.txtTuNgay.Text = DateTime.Now.ToString("dd/MM/yyyy");
            this.txtDenNgay.Text = DateTime.Now.ToString("dd/MM/yyyy");
            this.txtTuNgay.ReadOnly = true;
            this.txtDenNgay.ReadOnly = true;
            this.drpDiaBan.ReadOnly = true;
        }

        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
        }

        protected void RaiseClientEvent()
        {
            Utility.RegisterTypeForAjax(typeof(CMS.Presenters.Presenters.ListManager.BaoCaoDonThuPresenter));
        }

        #region ILookupView Members

        public string Message
        {
            set { throw new Exception("The method or operation is not implemented."); }
        }

        public bool IsRole
        {
            set
            {
                this.isRole = value;
            }
            get
            {
                return this.isRole;
            }

        }

        public bool IsValid
        {
            get { throw new Exception("The method or operation is not implemented."); }
        }

        public IList<LinhVuc> LinhVucs
        {
            get
            {
                return this.linhVucs;
            }
            set
            {
                this.linhVucs = value;
            }
        }

        public IList<DiaBan> DiaBans
        {
            get
            {
                return this.diaBans;
            }
            set
            {
                this.diaBans = value;
            }
        }

        public IList<LoaiDon> LoaiDons
        {
            get
            {
                return this.loaiDons;
            }
            set
            {
                this.loaiDons = value;
            }
        }

        #endregion
    }
}